import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

import 'coordinate_axis.dart';

class AxisPage extends StatefulWidget {
  const AxisPage({Key? key}) : super(key: key);

  @override
  _AxisPageState createState() => _AxisPageState();
}

class _AxisPageState extends State<AxisPage> {
  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.white,
      child: CustomPaint(
        // 使用CustomPaint
        painter: PaperPainter(),
      ),
    );
  }
}

class PaperPainter extends CustomPainter{
  final CoordinateAxis coordinate = CoordinateAxis();

  @override
  void paint(Canvas canvas, Size size) {
    coordinate.paint(canvas, size);
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) {
    return false;
  }

}
